<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>p2p平台 我要投资</title>
    <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
    <link rel="stylesheet" href="css/core.css" type="text/css">
    
    <script type="text/javascript" src="js/jquery-2.1.3.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/jquery.bootstrap.min.js"></script>
    <script type="text/javascript" src="js/jquery.form.min.js"></script>
    <script type="text/javascript" src="js/jquery.twbsPagination.js"></script>
    <script type="text/javascript" src="js/plugins-override.js"></script>
    <script type="text/javascript">
        function toPage(page){
            $("#myform").attr("action","invest?currPage="+page);
            $("#myform").submit();
        }
        $(function(){
            var searchForm = $("#searchForm");
            var gridBody = $("#gridBody"); 
            searchForm.ajaxForm(function(data){ 
                gridBody.hide();
                gridBody.html(data); 
                gridBody.show(500);
            });
            searchForm.submit();

            $("input[name=bidRequestState]").change(function(){
                $("#currentPage").val(1);
                searchForm.submit();
            });
/////////////////////
            var bidrequest = '${bid.bidRequest.returntype}';
            if (bidrequest==''){
                bidrequest=-1;
            }
            $("[name='bidrequest.returntype']").val(bidrequest);
            var currPage = ${pager.currPage};

            var totalPages = ${pager.totalPages};

            if (currPage >= totalPages){
                $("#next").removeAttr("href");
            }
            /////////////////////
        });
    </script>
</head>
<body>
<!-- 网页头信息 -->
<div class="el-header">
    <div class="container" style="position: relative;">
        <ul class="nav navbar-nav navbar-right">
            <li><a href="index.jsp">首页</a></li>
            <li><a href="login.html">登录</a></li>
            <li><a href="remove.jsp">注销</a></li>
            <li><a href="register.html">快速注册</a></li>
            <li><a href="invest.do#">帮助</a></li>
            <li><a href="uw.jsp">修改密码</a></li>
        </ul>
    </div>
</div>
<!-- 网页导航 -->
<div class="navbar navbar-default el-navbar">
    <div class="container">
        <div class="navbar-header">
            <a href="">
                <img alt="Brand" src="img/logo.png">
            </a>
        </div>
        <ul class="nav navbar-nav">
            <li id="index"><a href="index.do">首页</a></li>
            <li id="invest" class="active"><a href="invest.do">我要投资</a></li>
            <li id="borrow"><a href="borrow">我要借款</a></li>
            <li id="personal"><a href="personal.do">个人中心</a></li>
            <li><a href="invest.do#">新手指引</a></li>
            <li><a href="invest.do#">关于我们</a></li>
        </ul>
    </div>
</div>

<script type="text/javascript">
    $("#"+"invest").addClass("active");
</script>

<!-- 网页内容 -->
<div class="container" style="min-height: 500px;">
    <h4 class="page-title">投资列表</h4>
    <form id="myform" action="invest_list.do" id="searchForm" method="POST">
        <input type="hidden" name="currentPage" id="currentPage" value="1">
        <div style="margin: 20px 0px;">
            <span class="text-muted">标的状态</span><div style="margin-left: 30px" class="btn-group" data-toggle="buttons">
            <label class="btn btn-default active">
                <input type="radio" name="bidRequestState" value="-1" autocomplete="off" checked=""> 全部 
            </label>
            <label class="btn btn-default">
                <input type="radio" name="bidRequestState" value="1" autocomplete="off"> 招标中 
            </label>
            <label class="btn btn-default">
                <input type="radio" name="bidRequestState" value="8" autocomplete="off"> 已完成 
            </label>
        </div>
        </div>
    </form>
    <table class="table el-table table-hover">
        <thead id="gridHead">
        <tr>
            <th>借款人</th>
            <th width="180px">借款标题</th>
            <th>年利率</th>
            <th>金额</th>
            <th>还款方式</th>
            <th>进度</th>
            <th width="80px">操作</th>
        </tr>
        </thead>
        <tbody id="gridBody" style="display: table-row-group;">
        <%--<tr>
            <td>stef</td>
            <td>我穷啊</td>
            <td class="text-info">15%</td>
            <td class="text-info">1,200</td>
            <td>等额本息</td>
            <td>
                <div class="">
            100 %
            </div>
            </td>
            <td><a class="btn btn-danger btn-sm" href="borrow_info.do?id=2">查看</a></td>
            </tr>--%>
            <c:forEach items="${BidList}" var="b" varStatus="st">
                <tr align="center">
                <td>${b.logininfo.username}</td>
                <td>${b.bidrequesttitle }</td>
                <td>${b.actualrate }</td>
                <td>${b.availableAmount }</td>
                <td>${b.bidRequest.returntype }</td>
                <td>${b.bidRequest.currentsum }</td>
                <%--<td><fmt:formatDate  value="${user.birthdate }" pattern="yyyy-MM-dd"/></td>
                <td>${user.grade.gname }</td>--%>
                <%--<a href="javaScript:del('${user.sno }')">删除</a>--%>
                    <td>
                    <a class="btn btn-danger" href="borrow_info.do?id=${b.bidid }">操作</a>
                </td>
            </tr>
        </c:forEach>

        <script type="text/javascript">
            $(function(){
                $("#page_container").empty().append($('<ul id="pagination" class="pagination"></ul>'));
                $("#pagination").twbsPagination({
                    totalPages:2,
                    currentPage:1,
                    initiateStartPageClick:false,
                    onPageClick : function(event, page) {
                        $("#currentPage").val(page);
                        $("#searchForm").submit();
                    }
                });
            });
        </script></tbody>
    </table>
    <div style="text-align: center;">
        <ul id="pagination" class="pagination"><li class="first disabled"><a href="invest.do#">首页</a></li><li class="prev disabled"><a href="invest.do#">上一页</a></li><li class="page active"><a href="invest.do#">1</a></li><li class="page"><a href="invest.do#">2</a></li><li class="next"><a href="invest.do#">下一页</a></li><li class="last"><a href="invest.do#">最后一页</a></li></ul>
    </div> 
</div>

<!-- 网页版权 -->
<div class="container-foot-2">
    <div class="context">
        <div class="left">
            <p>版权所有： 广州xxx科技有限公司</p>
            <p>地  址： 广州市天河区棠下荷光三横路盛达商务园D座5楼</p>
            <p>电  话： 020-29007520  
                邮箱： service@520it.com</p>
            <p>
                <a href="http://www.miitbeian.gov.cn/" style="color: #ffffff">ICP备案
                    ：粤ICP备字1504547</a>
            </p>
            <p>
                <a href="http://www.gzjd.gov.cn/wlaqjc/open/validateSite.do" style="color: #ffffff">穗公网安备：44010650010086</a>
            </p>
        </div>
        <div class="right">
            <a target="_blank" href="http://weibo.com/ITxiaomage"><img src="img/sina.png"></a>
        </div>
        <div class="clearfix"></div>
    </div>
</div>
</body></html>
